﻿package mortal.game.net.command.guildWar
{
    import Framework.MQ.*;
    import Message.Command.*;
    import Message.Public.*;
    import mortal.game.cache.*;
    import mortal.game.mvc.*;
    import mortal.game.net.broadCast.*;
    import mortal.mvc.core.*;

    public class GuildWarCommand extends BroadCastCall
    {

        public function GuildWarCommand(param1:Object)
        {
            super(param1);
            return;
        }// end function

        override public function call(param1:MessageBlock) : void
        {
            var _loc_2:SGuildWarOpen = null;
            var _loc_3:SGuildWarScore = null;
            var _loc_4:SMyGuildWarScore = null;
            var _loc_5:SGuildWarInfo = null;
            var _loc_6:SGuildWarResult = null;
            var _loc_7:SSeqGuildWarPlayerScore = null;
            switch(param1.messageHead.command)
            {
                case EPublicCommand._ECmdPublicOpenGuildWar:
                {
                    _loc_2 = param1.messageBase as SGuildWarOpen;
                    Cache.instance.guildWar.guildWarOpen = _loc_2;
                    NetDispatcher.dispatchCmd(ServerCommand.GuildWarOpen, _loc_2);
                    break;
                }
                case EPublicCommand._ECmdPublicCloseGuildWar:
                {
                    Cache.instance.guildWar.guildWarOpen = null;
                    NetDispatcher.dispatchCmd(ServerCommand.GuildWarClose, null);
                    break;
                }
                case EPublicCommand._ECmdPublicGuildWarGuildScore:
                {
                    _loc_3 = param1.messageBase as SGuildWarScore;
                    Cache.instance.guildWar.guildWarScore = _loc_3;
                    NetDispatcher.dispatchCmd(ServerCommand.GuildWarGuildScore, _loc_3);
                    break;
                }
                case EPublicCommand._ECmdPublicGuildWarPlayerScore:
                {
                    _loc_4 = param1.messageBase as SMyGuildWarScore;
                    Cache.instance.guildWar.myScore = _loc_4;
                    NetDispatcher.dispatchCmd(ServerCommand.GuildWarPlayerScore, _loc_4);
                    break;
                }
                case EPublicCommand._ECmdPublicGuildWarInfo:
                {
                    _loc_5 = param1.messageBase as SGuildWarInfo;
                    Cache.instance.guildWar.guildWarInfo = _loc_5;
                    NetDispatcher.dispatchCmd(ServerCommand.GuildWarInfo, _loc_5);
                    break;
                }
                case EPublicCommand._ECmdPublicGuildWarResult:
                {
                    _loc_6 = param1.messageBase as SGuildWarResult;
                    Cache.instance.guildWar.guildWarResult = _loc_6;
                    NetDispatcher.dispatchCmd(ServerCommand.GuildWarResult, _loc_6);
                    break;
                }
                case EPublicCommand._ECmdPublicGuildWarSingleTime:
                {
                    Cache.instance.guildWar.guildWarSingleTimeInt = param1.messageBase as SPublicInt;
                    NetDispatcher.dispatchCmd(ServerCommand.GuildWarSingleTime, param1.messageBase);
                    break;
                }
                case EPublicCommand._ECmdPublicGuildWarPlayerScores:
                {
                    _loc_7 = param1.messageBase as SSeqGuildWarPlayerScore;
                    Cache.instance.guildWar.guildWarRankList = _loc_7.playerScores;
                    NetDispatcher.dispatchCmd(ServerCommand.GuildWarRankListUpdate, _loc_7);
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

    }
}
